<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>absolute</title>
    <style type="text/css">
        #contain1,#contain2,#contain3{
            border: solid 1px #666;
            width: 380px;
            height: 120px;
        }
        #contain2{
            position: absolute;
            left: 120px;
            top: 60px;
            background-color: #f08080;
        }
        #sub-div1{
            width: 80px;
            height: 80px;
            position: absolute;
            right: 10px;
            bottom: 10px;
            background-color:#fef68f;
        }
        #sub-div2{
            width: 80px;
            height: 80px;
            float: left;
            background-color: #dda0dd;
        }
        #sub-div3{
            width: 100px;
            height: 90px;
            background-color: #ccff66;
        }
    </style>
</head>
<body>
<div id="contain1">流动元素</div>
<div id="contain2">绝对定位元素
    <div id="sub-div1">子元素1-绝对定位</div>
    <div id="sub-div2">子元素2-浮动</div>
    <div id="sub-div3">子元素3-流动</div>
</div>
<div id="contain3">浮动元素</div>
</body>
</html>